from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkecs.request.v20140526.DescribeInstancesRequest import DescribeInstancesRequest

accessKeyId = ""
accessSecret = ""

client = AcsClient(accessKeyId, accessSecret, 'cn-beijing')

request = DescribeInstancesRequest()
request.set_accept_format('json')
request.set_accept_format("json")
page=1
page_size=10
request.set_PageSize(page_size)
request.set_PageNumber(page)

response = client.do_action_with_exception(request)

print(str(response, encoding='utf-8'))

